package io.adrainty.demo.seata.account.feign.impl;

import io.adrainty.demo.seata.account.feign.IAccountFeign;
import io.adrainty.demo.seata.account.models.entity.AccountEntity;
import io.adrainty.demo.seata.account.service.IAccountService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>AccountFeignController</p>
 *
 * @author AdRainty
 * @version V1.0.0
 * @description AccountFeignController
 * @since 2025/8/20 13:46:13
 */

@RestController
@RequestMapping("/account")
public class AccountFeignController implements IAccountFeign {

    @Resource
    private IAccountService accountService;

    @Override
    @PostMapping("/addAccountBalance")
    public Boolean addAccountBalance(@RequestBody AccountEntity param) {
        return accountService.addAccountBalance(param);
    }

    @Override
    public Boolean frozenBalance(AccountEntity param) {
        return false;
    }

    @Override
    public Boolean rollBackAccountBalance(AccountEntity accountEntity) {
        return false;
    }

}
